package ch.ethz.fcl.metrobuzz.data.transit.bus;

import ch.ethz.fcl.metrobuzz.data.transit.Stop;
import ch.ethz.fcl.metrobuzz.tools.MBTools;

/**
 * record start and end time of bus transit from raw data
 * 
 * @author ZengWei
 * 
 */
public class BusPair {
	private Stop firstTapIn;
	private float startTime;

	private Stop lastTapOut;
	private float endTime;

	public BusPair(Stop firstTapIn, float startTime, Stop lastTapOut,
			float endTime) {
		this.firstTapIn = firstTapIn;
		this.startTime = startTime;

		this.lastTapOut = lastTapOut;
		this.endTime = endTime;
	}

	public Stop getFirstTapIn() {
		return firstTapIn;
	}

	public float getStartTime() {
		return startTime;
	}

	public Stop getLastTapOut() {
		return lastTapOut;
	}

	public float getEndTime() {
		return endTime;
	}

	public String toString() {
		String s = "Bus pair: (" + firstTapIn.getId() + ", "
				+ MBTools.formatTimeInSeconds(startTime) + ") to ("
				+ lastTapOut.getId() + ", "
				+ MBTools.formatTimeInSeconds(endTime) + ")";
		return s;
	}
}